package com.ruoyi.report.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.report.mapper.ReportConfigMapper;
import com.ruoyi.report.domain.ReportConfig;
import com.ruoyi.report.service.IReportConfigService;
import com.ruoyi.common.core.text.Convert;

/**
 * 报配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-17
 */
@Service
public class ReportConfigServiceImpl implements IReportConfigService 
{
    @Autowired
    private ReportConfigMapper reportConfigMapper;

    /**
     * 查询报配置
     * 
     * @param configId 报配置主键
     * @return 报配置
     */
    @Override
    public ReportConfig selectReportConfigByConfigId(Long configId)
    {
        return reportConfigMapper.selectReportConfigByConfigId(configId);
    }

    /**
     * 查询报配置列表
     * 
     * @param reportConfig 报配置
     * @return 报配置
     */
    @Override
    public List<ReportConfig> selectReportConfigList(ReportConfig reportConfig)
    {
        return reportConfigMapper.selectReportConfigList(reportConfig);
    }

    /**
     * 新增报配置
     * 
     * @param reportConfig 报配置
     * @return 结果
     */
    @Override
    public int insertReportConfig(ReportConfig reportConfig)
    {
        reportConfig.setCreateTime(DateUtils.getNowDate());
        return reportConfigMapper.insertReportConfig(reportConfig);
    }

    /**
     * 修改报配置
     * 
     * @param reportConfig 报配置
     * @return 结果
     */
    @Override
    public int updateReportConfig(ReportConfig reportConfig)
    {
        reportConfig.setUpdateTime(DateUtils.getNowDate());
        return reportConfigMapper.updateReportConfig(reportConfig);
    }

    /**
     * 批量删除报配置
     * 
     * @param configIds 需要删除的报配置主键
     * @return 结果
     */
    @Override
    public int deleteReportConfigByConfigIds(String configIds)
    {
        return reportConfigMapper.deleteReportConfigByConfigIds(Convert.toStrArray(configIds));
    }

    /**
     * 删除报配置信息
     * 
     * @param configId 报配置主键
     * @return 结果
     */
    @Override
    public int deleteReportConfigByConfigId(Long configId)
    {
        return reportConfigMapper.deleteReportConfigByConfigId(configId);
    }
}
